﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ArcEngine.Editor.Wizards
{
	public partial class NewAnimationWizard : Form
	{
		public NewAnimationWizard()
		{
			InitializeComponent();
		}


		/// <summary>
		/// FormClosing event
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void OnFormClosing(object sender, FormClosingEventArgs e)
		{
			// 
			if (DialogResult != DialogResult.OK)
				return;


			// No name selected
			if (AnimationNameBox.Text == "")
			{
				MessageBox.Show("Select an animation name first!");
				e.Cancel = true;
				return;
			}

			// Entity already exists ?
			if (ResourceManager.GetLayout(AnimationNameBox.Text) != null)
			{
				MessageBox.Show("Animation name already in use or invalid. Use another name !");
				e.Cancel = true;
				return;
			}



			ResourceManager.CreateAnimation(AnimationNameBox.Text);
		}




	}

}
